package org.jeecg.modules.business.delivery.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.business.delivery.entity.WmsDeliveryTaskMaterial;
import org.jeecg.modules.business.delivery.entity.WmsDeliveryTask;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.business.delivery.entity.vo.*;
import org.jeecg.modules.business.transfer.vo.WmsMoveReceiptPage;
import org.jeecg.modules.business.transfer.vo.WmsMoveReceiptVO;
import org.jeecg.modules.flow.callback.enums.SimpleDocumentTypeEnum;
import org.jeecg.modules.flow.callback.enums.TransferStatusEnum;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 调拨任务
 * @Author: jeecg-boot
 * @Date:   2023-11-22
 * @Version: V1.0
 */
public interface IWmsDeliveryTaskService extends IService<WmsDeliveryTask> {

	/**
	 * 调拨任务-分页列表查询
	 * @param page
	 * @param wmsDeliveryTask
	 * @return
	 */

	IPage<WmsDeliveryTaskPageVO> listByPage(IPage<WmsDeliveryTask> page, WmsDeliveryTaskQueryVO wmsDeliveryTask);

	/**
	 * 添加一对多
	 *
	 * @param wmsDeliveryTask
	 * @param wmsDeliveryTaskMaterialList
	 */
	public String saveMain(WmsDeliveryTask wmsDeliveryTask,List<WmsDeliveryTaskMaterial> wmsDeliveryTaskMaterialList) ;

	/**
	 * 修改一对多
	 *
   * @param wmsDeliveryTask
   * @param wmsDeliveryTaskMaterialList
	 */
	public void updateMain(WmsDeliveryTask wmsDeliveryTask,List<WmsDeliveryTaskMaterial> wmsDeliveryTaskMaterialList);

	/**
	 * 删除一对多
	 *
	 * @param id
	 */
	public void delMain (String id);

	/**
	 * 批量删除一对多
	 *
	 * @param idList
	 */
	public void delBatchMain (Collection<? extends Serializable> idList);

	/**
	 * 下查
	 * @param taskId
	 * @param type
	 * @return
	 */
    List<DeliveryUnderListVO> underList(String taskId, String type);

	/**
	 * 条料调拨因入移库单-从入库任务中获取移库物料信息
	 * @param needMoveMaterialVO
	 * @return
	 */
	WmsMoveReceiptVO getMoveMaterialFormInTask(NeedMoveMaterialVO needMoveMaterialVO);

	/**
	 * 条料调拨因出移库单-从出库任务中获取移库物料信息
	 * @param needMoveMaterialVO
	 * @return
	 */
	WmsMoveReceiptVO getMoveMaterialFormOutTask(NeedMoveMaterialVO needMoveMaterialVO);

	/**
	 * 条料调拨因出移库单-叫料架
	 * @param askMaterialRackVO
	 */
    void askMaterialRack(AskMaterialRackVO askMaterialRackVO);

	/**
	 * 更新过账状态
	 * @param simpleDocumentType
	 * @param taskId
	 * @param transferStatus
	 */
    void updateTransferStatus(SimpleDocumentTypeEnum simpleDocumentType, String taskId, TransferStatusEnum transferStatus);

	/**
	 * 调拨任务过账
	 * @param taskId
	 * @return
	 */
    List<String> deliveryTaskTransfer(String taskId);


}
